<template>
  <div class="m-money">
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多数据了"
      @load="onLoad"
    >
      <van-cell
        v-for="item in list"
        :key="item.id"
        :title="item.kname"
        :value="item.deals + ' 元'"
        style="text-align: center"
      />
    </van-list>
  </div>
</template>
<script>
import List from 'vant/lib/list'
import Cell from 'vant/lib/cell'
import 'vant/lib/list/style'
import 'vant/lib/cell/style'
import { mapGetters } from 'vuex'
import { getKeeperBySid } from '@/api/mobile_ym'
// import { getShopClerks } from '@/api/txs'

export default {
  components: {
    [Cell.name]: Cell,
    [List.name]: List
  },
  data () {
    return {
      list: [],
      loading: false,
      finished: false
    }
  },
  computed: {
    ...mapGetters(['openId'])
  },
  // created () {
  //   this.fetchData()
  // },
  methods: {
    onLoad () {
      this.loading = false
      getKeeperBySid(this.openId).then(res => {
        this.list = res.data.data
        this.finished = true
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.m-money > .van-list >.van-cell >.van-cell__value > span{
  color: red !important;
}
</style>
